"use strict";
function showA(a, b) {
    console.log(a, b);
}
// showA(1,"asda");
showA("asda", true);
//非严格模式下，形参不定义变量类型，默认为any
// function showB(a,b,c){
//     console.log(a,b,c);
// }
// showB(1,"qweq",true);
function ShowC(a, b, c) {
    console.log(a, b);
}
ShowC("123", 123);
ShowC("123", 123, 1231);
//默认参数
function showD(a, b) {
    if (b === void 0) { b = "asd"; }
}
//不能确定传实参的时候第二位到底传还是没传 会报错
// function showE(a:string,b?:number = 123,c?:string){
// }
// showE("asda")
function showE(arg) {
    if (arg === void 0) { arg = "默认值"; }
    console.log(arg);
}
function showF(arg) {
    arg = arg || "默认值";
}
function get(url, data, callback, type) {
    if (typeof data === "function") {
        type = callback;
        callback = data;
        data = undefined;
    }
}
function showG() {
    return "asda";
}
function showH() {
    console.log(1);
    // return as;
    return;
    console.log(2);
}
function showI() {
    throw new Error("错误");
}
function showJ(params) {
    if (params) {
        return "真";
    }
    else {
        return "假";
    }
}
showJ(true);
function showK(params) {
    try {
        return JSON.parse(params);
    }
    catch (error) {
        throw error;
    }
}
